﻿import requests
from jsonpath import jsonpath
import threading,time

count = 0
for i in range(1,101):

    encrypt_data=requests.get("http://127.0.0.1:12080/go?group=v&name=test&action=get_v").json()
    print(encrypt_data)
    data=encrypt_data["get_v"]
    # print(encrypt_data.text)
    print(data)
    url="http://spider.wangluozhe.com/challenge/api/6"
    params={
        "page":i,
        "count":"10"
    }
    headers={
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36",
        "Cookie": f"cookie v={data}"
    }
    response=requests.post(url=url,data=params,headers=headers)

    print(response.content.decode())
    try:
        num=jsonpath(response,"$..value")
        print(num)
        for z in num:
            count+=z
        print(i)
    except:
        print(f"{i}pass了")

    print(count)




